<template>
  <div class="echart-card">
    <div
      v-for="(item, index) in ChartsTableList"
      :key="index"
      :class="item.type"
      class="echart-card-item"
    >
      <div style="display: flex;align-items: center;">
        <div class="echart-card-item-name">
          {{ item.name }}
        </div>
         <div class="echart-card-item-number">
          {{ item.number }}
        </div>
      </div>
     
      <div class="echart-card-item-icon">
        <svg-icon :icon-class="item.icon" />
      </div>
    </div>
  </div>
</template>
<script>
export default {
  data() {
    return {};
  },
  props: {
    ChartsTableList: {
      type: Array,
      default: [],
    },
  },
};
</script>
<style scoped lang="scss">
.echart-card {
  display: flex;
  .echart-card-item {
    width: 100%;
    height: 65px;
    margin: 20px;
    margin-bottom: 10px;
    border-radius: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 30px;
    color: #3d3d3d;
    font-size: 14px;
    transition: transform 0.5s ease;
    .echart-card-item-name{
      font-weight: 600;
    }
   
    .echart-card-item-number {
      font-size: 24px;
      font-weight: 700;
      margin-left: 10px;
    }
    .echart-card-item-icon {
      border-radius: 5px;
      padding: 6px;
      .svg-icon {
        width: 23px;
        height: 23px;
      }
    }
  }
  // 总数
  .total {
    border: 2px solid rgba(11, 83, 250, 1); // #0b53fa
    border-left: 5px solid rgba(11, 83, 250, 1);
    box-shadow: 0 4px 8px rgba(11, 83, 250, 0.3); // 添加蓝色阴影
    .echart-card-item-number {
      color: #0b53fa;
    }
    .echart-card-item-icon {
      background: rgba(11, 83, 250, 0.2);
    }
  }
  // 在线
  .devOnline {
    border: 2px solid rgba(26, 179, 148, 1); //#1ab394
    border-left: 4px solid rgba(26, 179, 148, 1);
    box-shadow: 0 4px 8px rgba(26, 179, 148, 0.3);
    .echart-card-item-number {
      color: #387afe;
    }
    .echart-card-item-icon {
      background: rgba(26, 179, 148, 0.2);
    }
  }
  // 离线
  .devoffline {
    border: 2px solid rgba(245, 63, 63, 1); // #f53f3f
    border-left: 5px solid rgba(245, 63, 63, 1);
    box-shadow: 0 4px 8px rgba(245, 63, 63, 0.3);
    .echart-card-item-number {
      color: rgba(245, 63, 63, 1);
    }
    .echart-card-item-icon {
      background: rgba(245, 63, 63, 0.2);
      padding: 9px;
    }
  }
  // 预警
  .warn{
    border: 2px solid rgba(219, 114, 7, 1); //#db7207
    border-left: 5px solid rgba(219, 114, 7, 1);
    box-shadow: 0 4px 8px rgba(219, 114, 7, 0.3);
    .echart-card-item-number {
      color: rgba(219, 114, 7, 1);
    }
    .echart-card-item-icon {
      background: rgba(219, 114, 7, 0.2);
    }
  }
  // 故障   icon:"echartCardFault"
  .fault {
    border: 2px solid rgb(160 180 255); //#A0B4FF
    border-left: 5px solid rgb(160 180 255);
    box-shadow: 0 4px 8px rgba(160, 180, 255, 0.3);
    .echart-card-item-number {
      color: rgb(160 180 255);
    }
    .echart-card-item-icon {
      background: rgba(160, 180, 255, 0.2);
    }
  }
  .echart-card-item:hover {
    transform: translateY(-3px);
  }
}
</style>
